package com.huawei.crm.mapper;

import com.huawei.crm.domain.Role;
import com.huawei.crm.query.QueryObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RoleMapper extends BaseRepository<Role, Long> {

    List<Role> selectAll();

    List<Role> selectForList(QueryObject qo);

    /**
     * 删除角色和权限的关系
     *
     * @param roleId
     */
    void deleteRoleAndPermissionRelation(Long roleId);

    /**
     * 插入角色和权限的关系
     *
     * @param roleId
     * @param permissionId
     */
    void insertRoleAndPermissionRelation(@Param("roleId") Long roleId, @Param("permissionId") Long permissionId);

    List<String> selectSnByEmpId(Long id);
}